/************************************************************
** Archivo:		FotoView
** Autor:		
** Fecha:		16/05/2009 19:19:03
** Descripción:	Clase generada automáticamente
** Cliente:		SC
** Proyecto:	eWedding
************************************************************/

using System;
using System.Collections.Generic;
using System.Text;

using Circo.Framework.BusinessLogic;
using Circo.Framework.Persistencia;

using SC.eWedding.Data.Entities;


namespace SC.eWedding.BusinessLogic.Views
{
    public partial class FotoView : AbstractView
    {
    
        #region Private Vars

		private FotoEntity _foto;

        #endregion

        #region Constructors

		
		public FotoView()
		{
			CrearVista(false);
		}

		public FotoView(bool createRelatedViews)
		{
			CrearVista(createRelatedViews);
		}

		private void CrearVista(bool createRelatedViews)
		{
			this._foto = new FotoEntity();

			if (createRelatedViews)

			{

				this.ProdSer = new ProdSerView(true);

			}

		}

		public FotoView(FotoEntity unaEntidad)
		{
			if (unaEntidad != null)
				this._foto = unaEntidad;

		}



        #endregion
        
        #region Attributes

		
		public int Id
		{
			get { return this._foto.Id; }
			set { this._foto.Id = value; }
		}

		public string Nombre
		{
			get { return this._foto.Nombre; }
			set { this._foto.Nombre = value; }
		}

		public string Descripcion
		{
			get { return this._foto.Descripcion; }
			set { this._foto.Descripcion = value; }
		}

		private ProdSerView _prodSer = null;
		public ProdSerView ProdSer
		{
			get
			{
				if (this._prodSer == null)
				{
					if (this._foto.ProdSer != null)
						this._prodSer = new ProdSerView(this._foto.ProdSer);
				}
				return _prodSer;
			}
			set
			{
				if (value != null)
				{
					this._foto.ProdSer = value.MapToEntity();
					this._prodSer = new ProdSerView(this._foto.ProdSer);
				}
				else
				{
					this._foto.ProdSer = null;
					this._prodSer = null;
				}
			}
		}

		public byte[] Imagen
		{
			get { return this._foto.Imagen; }
			set { this._foto.Imagen = value; }
		}


        #endregion

        #region Mapping

		
		public FotoEntity MapToEntity()
		{
			return this._foto;
		}

		public override Entity MapToBaseEntity()
		{
			return MapToEntity();
		}



        #endregion

        #region CollectionSyncro

		

        #endregion
        
    }
}
